package cate.game.pvp.throne;

import cate.game.framework.ModuleMan;
import cate.game.pvp.throne.msg.*;
import cp.solution.rpc.RpcMsgHead;
import easy.java.dev.note.NoteClass;

@NoteClass("王座争霸-Game接收消息模块")
public class TBGameReceiveModule extends ModuleMan {

    @Override
    public void initDependent() throws Exception {
        game.rpcRecv().onFireAndForgetTemplate(TBInnerMsg.NOTICE_ALL, TBAllDataNotice.class, this::syncAllData);
        game.rpcRecv().onFireAndForgetTemplate(TBInnerMsg.NOTICE_PART, TBPartDataNotice.class, this::syncPartData);
        game.rpcRecv().onFireAndForgetTemplate(TBInnerMsg.NOTICE_KO_BASE, TBKoBaseNotice.class, this::syncKoBaseData);
        game.rpcRecv().onFireAndForgetTemplate(TBInnerMsg.NOTICE_BET, TBKoBetNotice.class, this::syncKoBetData);
        game.rpcRecv().onFireAndForgetTemplate(TBInnerMsg.NOTICE_BOSS, TBBossNotice.class, this::syncBoss);
    }

    public void syncAllData(RpcMsgHead head, TBAllDataNotice notice) {
        game.pvp.throne.data.syncAllData(notice);
    }

    public void syncPartData(RpcMsgHead head, TBPartDataNotice notice) {
        game.pvp.throne.data.syncPartData(notice);
    }

    public void syncKoBaseData(RpcMsgHead head, TBKoBaseNotice notice) {
        game.pvp.throne.data.syncKoBase(notice);
    }

    public void syncKoBetData(RpcMsgHead head, TBKoBetNotice notice) {
        game.pvp.throne.data.syncKoBet(notice);
    }

    public void syncBoss(RpcMsgHead head, TBBossNotice notice) {
        game.pvp.throne.data.syncBoss(notice);
    }
}
